<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<link rel="stylesheet" href="css/form.css" />
</head>

<body>
	<div id="header-wrap" data-mn="0">
		<a href="###" data-link="safe" data-type="ico" class="left ico-m ico-left"></a>
		<h2>银行卡管理</h2>
	</div>
	<div class="" id="">
		<div class="tips">
			<div class="t-info">验证银行预留手机号</div>
			<div class="t-error"></div>
		</div>
		<form id="" >
		<ul class="form-list">
			<li class="ico-m ico-pl ico-mobile" data-type="ico">
				<div class="fl-cont form-input">
					<input id="id_input" type="number" class="preset" placeholder="请输入银行预留手机号" />
				</div>
			</li>
			<li class="ico-m ico-pl ico-mail" data-type="ico">
				<div class="fl-cont form-input f-right-btn">
					<input id="yzm" type="number" placeholder="短信验证码" />
					<a href="###" id="yzm_btn" class="btn b-blue">获取验证码</a>
				</div>
			</li>
		</ul>
		<div class="">
			<a href="###" data-link="edit-bcard-3" class="btn b-red"><span id="check">绑定</span></a>
		</div>
		<ul class="label-list">
			<li class="">
				<label>银行卡号：</label>
				<div class="ll-cont"><span id="info_card"></span></div>
			</li>
			<li class="">
				<label>所属银行：</label>
				<div class="ll-cont"><span id="info_bank">中国工商银行借记卡</span></div>
			</li>
			<li class="">
				<label>持卡人：</label>
				<div class="ll-cont"><span id="info_name"></span></div>
			</li>
			<li class="">
				<label>身份证号：</label>
				<div class="ll-cont"><span id="info_id"></span></div>
			</li>
		</ul>
		</form>
		<div class="feed-info">
			<h2>免费绑卡！</h2>
			绑定银行卡需要2.00元手续费，该费用在您绑卡成功后，将返还至您的账户余额！<br /><br />
			客服电话：400-105-8851<br />
			微信客服：wuyifugui(公众号)
		</div>
	</div>
	<script>
	$(function(){
		var name = $.cookie("name_show")
		var id = $.cookie("id_show")
		var card = $.cookie("cb_temp")
		var moblie = $.cookie("user_id")
		$("#info_name").text(name)
		$("#info_id").text(id)
		$("#info_card").text(card);
		$("#id_input").val(moblie);
		
		$("#yzm_btn").on("click",function(){
			yzm()
		})
		$("#check").on("click",function(){
			var yzm = $("#yzm").val();
			var id_input = $("#id_input").val();
			var id_temp = $.cookie("id_temp");
			var yzm_code = $.cookie("yzm")
			if(id_input !== id_temp && id_temp !== undefined){
				$(".t-error").text("无效手机号").fadeIn()
				$(".t-info").hide()
				reset_tip()
				return false
			}else if(yzm !== yzm_code){
				$(".t-error").text("无效短信验证码").fadeIn()
				$(".t-info").hide()
				reset_tip()
				return false
			}else{
				var bc = $.cookie("cb_temp")
				var bc_show = "";
				bc_show = bc.match(/^\d{4}/)+"********"+bc.match(/\w{4}$/)
				bc_show_2 = "尾号"+bc.match(/\w{4}$/)
				$.cookie("bc_show",bc_show)
				$.cookie("bc_show_2",bc_show_2)
				$("#set_bc").text(bc_show)
				$.cookie("bcard",bc);
				$.cookie("bc_show",bc_show);
				$.cookie("bank_mobile","",{expires: -1})
				$.cookie("cb_temp","",{expires: -1})
				$.cookie("id_temp","",{expires: -1})
				$.cookie("yzm","",{expires: -1})
			}
		})
	})
	</script>	
</body>

</html>
